package com.kfgj.hkp.common.enums;


import com.kfgj.hkp.common.dic.Dictionary;
import com.kfgj.hkp.common.dic.DictionaryProvider;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class ClientType implements DictionaryProvider {

    public static final Dictionary ClientType;
    public static final Dictionary PC;
    public static final Dictionary Iphone;
    public static final Dictionary Iphone_APP;
    public static final Dictionary Iphone_Browser;
    public static final Dictionary Android;
    public static final Dictionary Android_APP;
    public static final Dictionary Android_Browser;
    public static final Dictionary WeiXin;
    public static final Dictionary WeiXin_Android;
    public static final Dictionary WeiXin_Iphone;

    static {
        ClientType = new Dictionary(getClientTypeKey(),getClientTypeParentCode(),"接口端类型");
        PC = new Dictionary(getClientTypeKey(),"pc","PC浏览器",getClientTypeParentCode());
        Iphone = new Dictionary(getClientTypeKey(),"iphone","苹果手机",getClientTypeParentCode());
        Iphone_APP =  new Dictionary(getClientTypeKey(),"iphone_app","苹果APP",getClientTypeParentCode());
        Iphone_Browser =  new Dictionary(getClientTypeKey(),"iphone_browser","苹果手机浏览器",getClientTypeParentCode());
        Android =  new Dictionary(getClientTypeKey(),"android","安卓手机",getClientTypeParentCode());
        Android_APP =  new Dictionary(getClientTypeKey(),"android_app","安卓APP",getClientTypeParentCode());
        Android_Browser =  new Dictionary(getClientTypeKey(),"adroid_browser","安卓手机浏览器",getClientTypeParentCode());
        WeiXin =  new Dictionary(getClientTypeKey(),"weixin","微信",getClientTypeParentCode());
        WeiXin_Android =  new Dictionary(getClientTypeKey(),"weixin_android","微信安卓版",getClientTypeParentCode());
        WeiXin_Iphone =  new Dictionary(getClientTypeKey(),"weixin_iphone","微信苹果版",getClientTypeParentCode());
    }

    public List<Dictionary> produce() {

        List<Dictionary> list = new ArrayList<Dictionary>();

        list.add(ClientType);
        list.add(Iphone);
        list.add(Iphone_APP);
        list.add(Iphone_Browser);
        list.add(Android);
        list.add(Android_APP);
        list.add(Android_Browser);
        list.add(WeiXin);
        list.add(WeiXin_Android);
        list.add(WeiXin_Iphone);

        return list;
    }
    
    public static String getClientTypeKey(){
        return ClientType.class.getName();
    }
    
    public static String getClientTypeParentCode(){
        return ClientType.class.getSimpleName();
    }
}
